//
//  CheckPhoneChargeInfoResponse.m
//  EasyToo
//
//  Created by YuanDee on 13-9-5.
//
//

#import "CheckPhoneChargeInfoResponse.h"
#import "PhoneCardInfo.h"

@implementation CheckPhoneChargeInfoResponse
- (void)parse
{
    [super parse];
    
    if (self.bodyDict)
    {
        self.cardArea = GetDictionaryStringDefaultNil(self.bodyDict, @"area");
        self.cardType = GetDictionaryStringDefaultNil(self.bodyDict, @"cardtype");
        self.cardInfoArray = [[NSMutableArray alloc] init];
        NSArray *phoneCardJsonArray = GetDictionaryArrayDefaultNil(GetDictionaryDictionaryDefaultNil(self.bodyDict, @"cards"), @"card");
        NSLog(@"phonecardjsonarray is:%@\n", phoneCardJsonArray);
        for (int i = 0; i < [phoneCardJsonArray count]; i++)
        {
            NSDictionary *phoneCardInfoJson = [phoneCardJsonArray objectAtIndex:i];
            PhoneCardInfo *cardInfo = [[PhoneCardInfo alloc] initWithDictionary:phoneCardInfoJson];
            
            [self.cardInfoArray addObject:cardInfo];
            
            [cardInfo release];
        }
        
    }
}


@end
